package com.edu.koTA07.takingOrder;

import java.io.InputStream;
import java.util.ArrayList;

import com.edu.koTA07.XmlDataSet.DiskonXmlDataSet;
import com.edu.koTA07.adapter.DiskonListAdapter;
import com.edu.koTA07.xmlreader.DiskonXMLtoDataSet;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

public class InfoDiskon extends Activity {	
	/** Called when the activity is first created. */
	private ListView diskonsList;
    private ArrayList<String> diskons;
    DiskonXmlDataSet diskon = null;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.info_diskon);
        InputStream in = this.getResources().openRawResource(R.raw.diskon);
		DiskonXMLtoDataSet diskonXMLtoBean = new DiskonXMLtoDataSet(in);
		diskon = diskonXMLtoBean.getDiskonList();
		init();
    }  
	
	public void init(){
    	diskonsList = (ListView) findViewById(R.id.list_diskon);
    	//customers = new ArrayList<String>();
        
    	diskons = diskon.getBesarDiskon();
    	DiskonListAdapter diskonListAdapter = new DiskonListAdapter(InfoDiskon.this, R.layout.content_diskon, diskons, diskon);
		diskonsList.setAdapter(diskonListAdapter);
	}
}   